package net.quanter.demo.junit5.springboot.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

/***
 *
 * @(#) 2020-09-13
 * @author 王老实
 *
 */
@RestController
public class Java11Controller {

    /**
     * var 变量推导
     */
    @PostMapping("/var")
    public List<String> var() {
        var list = List.of("AA", "BB");
        return list.stream()
            .map(x -> x.repeat(2))
            .collect(Collectors.toList());
    }
}
